package com.itheima;

import cn.itcast.bos.Dao.take_delicery.WayBillDao;
import cn.itcast.bos.domain.take_delivery.WayBill;
import cn.itcast.bos.index.WayBillIndexRepository;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class SyncIndex {

    @Autowired
  private   WayBillIndexRepository wayBillIndexRepository;
    @Autowired
    private WayBillDao wayBillDao;
    @Test
    public void test(){
      List<WayBill> wayBills = wayBillDao.findAll();
      wayBillIndexRepository.save(wayBills);

    }
}
